import req from "./request";

/**登录接口 */
export const userLogin = (data) => {
  return req({
    url: "/user/login",
    method: "post",
    data,
  });
};
/**注册接口 */
export const userRegister = (data) => {
  return req({
    url: "/user/register",
    method: "post",
    data,
  });
};

/**通用上传 */
export const uploadFile = (data) => {
  return req({
    url: "/common/upload",
    method: "post",
    headers: {
      "Content-Type": "multipart/form-data",
    },
    data,
  });
};

/**更新用户信息 */
export const updateUserInfo = (data) => {
  return req({
    url: "/user/info/update",
    method: "post",
    data,
  });
};

/**获取新闻政策 */
export const reqGetNewsList = (data) => {
  return req({
    url: "/news/list",
    method: "post",
    data,
  });
};
/**添加新闻政策 */
export const reqAddNew = (data) => {
  return req({
    url: "/news/save",
    method: "post",
    data,
  });
};
/**获取新闻详情 */
export const reqGetNewsDetail = (id) => {
  return req({
    url: `/news/getInfo/${id}`,
    method: "get",
  });
};
/**更新新闻 */
export const reqUpdateNews = (data) => {
  return req({
    url: `/news/update`,
    method: "put",
    data,
  });
};
/**删除新闻 */
export const reqDeleteNews = (id) => {
  return req({
    url: `/news/remove/${id}`,
    method: "delete",
  });
};

/**获取岗位列表 */
export const reqGetJobList = (data) => {
  return req({
    url: "/post/list",
    method: "post",
    data,
  });
};

/**添加岗位 */
export const reqAddJob = (data) => {
  return req({
    url: "/post/save",
    method: "post",
    data,
  });
};
/**更新岗位 */
export const reqUpdateJob = (data) => {
  return req({
    url: "/post/update",
    method: "put",
    data,
  });
};
/**获取岗位详情 */
export const reqGetJobDetail = (id) => {
  return req({
    url: `/post/getInfo/${id}`,
    method: "get",
  });
};
/**删除岗位 */
export const reqDelJob = (id) => {
  return req({
    url: `/post/remove/${id}`,
    method: "delete",
  });
};

/**添加简历 */
export const reqAddResume = (data) => {
  return req({
    url: "/curriculumVitae/save",
    method: "post",
    data,
  });
};
/**编辑简历 */
export const reqUpdateResume = (data) => {
  return req({
    url: "/curriculumVitae/update",
    method: "put",
    data,
  });
};

/**获取简历详情 */
export const reqGetResumeDetail = (userId) => {
  return req({
    url: `/curriculumVitae/getInfo/${userId}`,
    method: "get",
  });
};

/**岗位申请 */
export const reqApplyJob = (postId) => {
  return req({
    url: `/postApply/save/${postId}`,
    method: "post",
  });
};
/**岗位申请列表 */
export const reqApplyList = (data) => {
  return req({
    url: `/postApply/list`,
    method: "post",
    data,
  });
};
/**岗位申请数据统计 */
export const reqApplyStat = (data) => {
  return req({
    url: `/postApply/stat`,
    method: "post",
    data,
  });
};
/**岗位审批 */
export const reqApplyExamine = (data) => {
  return req({
    url: `/postApply/examine`,
    method: "post",
    data,
  });
};

/**事务列表 */
export const reqGetTaskList = (data) => {
  return req({
    url: `/matters/list`,
    method: "post",
    data,
  });
};

/**添加服务事项 */
export const reqAddTask = (data) => {
  return req({
    url: `/matters/save`,
    method: "post",
    data,
  });
};
/**更新服务事项 */
export const reqUpdateTask = (data) => {
  return req({
    url: `/matters/update`,
    method: "put",
    data,
  });
};
/**删除服务事项 */
export const reqDeleteTask = (id) => {
  return req({
    url: `/matters/remove/${id}`,
    method: "delete",
  });
};

/**服务事务申请 */
export const reqApplyTask = (data) => {
  return req({
    url: `/mattersApply/save`,
    method: "post",
    data,
  });
};

/**服务事务申请列表 */
export const reqApplyTaskList = (data) => {
  return req({
    url: `/mattersApply/list`,
    method: "post",
    data,
  });
};
/**服务事务审批 */
export const reqApplyTaskSp = (data) => {
  return req({
    url: `/mattersApply/examine`,
    method: "post",
    data,
  });
};

/**未读消息数量统计 */
export const reqUnreadCount = () => {
  return req({
    url: `/message/stat`,
    method: "get",
  });
};

/**查询所有消息 */
export const reqMessageList = () => {
  return req({
    url: `/message/list`,
    method: "get",
  });
};
/**设为已读 */
export const reqReadMessage = (data) => {
  return req({
    url: `/message/update`,
    method: "put",
    data,
  });
};
/**提交建议 */
export const reqSuggestion = (data) => {
  return req({
    url: `/advice/save`,
    method: "post",
    data,
  });
};
/**建议列表 */

export const reqGetSuggestionList = (data) => {
  return req({
    url: `/advice/list`,
    method: "post",
    data,
  });
};
